<template>
  <div>
        <el-form ref="form" :model="form" label-width="80px">
          <el-row>
              <el-col :span="12">
                  <el-form-item label="小区">
                      <el-input v-model="form.area"></el-input>
                  </el-form-item>
              </el-col>
              <el-col :span="12">
                  <el-form-item label="姓名" >
                      <el-input v-model="form.name"></el-input>
                  </el-form-item>
              </el-col>
          </el-row>
          <el-row>
              <el-col :span="12">
                  <el-form-item label="手机号" >
                      <el-input v-model="form.phone"></el-input>
                  </el-form-item>
              </el-col>
              <el-col :span="12">
                  <el-form-item label="身份证" >
                      <el-input v-model="form.idcard"></el-input>
                  </el-form-item>
              </el-col>
          </el-row>
          <el-row>
              <el-col :span="12">
                  <el-form-item label="家庭住址" >
                      <el-input v-model="form.address"></el-input>
                  </el-form-item>
              </el-col>
              <el-col :span="12">
                  <el-form-item label="车牌号" >
                      <el-input v-model="form.carNumber"></el-input>
                  </el-form-item>
              </el-col>
          </el-row>
          <el-row>
              <el-col :span="12">
                  <el-form-item label="体温">
                      <el-input-number v-model="form.temper" :min="30" :max="42" ></el-input-number>
                  </el-form-item>
              </el-col>
              <el-col :span="12">
                  <el-form-item label="年龄">
                      <el-input-number v-model="form.age" :min="1" :max="99" ></el-input-number>
                  </el-form-item>
              </el-col>
          </el-row>
          <el-row>
              <el-col :span="12">
                  <el-form-item label="是否重症">
                      <el-radio-group v-model="form.isSevere">
                          <el-radio :label="0">否</el-radio>
                          <el-radio :label="1">是</el-radio>
                      </el-radio-group>
                  </el-form-item>
              </el-col>
              <el-col :span="12">
                  <el-form-item label="性别" >
                      <el-radio-group v-model="form.gender">
                          <el-radio :label="0">男</el-radio>
                        <el-radio :label="1">女</el-radio>
                      </el-radio-group>
                  </el-form-item>
              </el-col>
          </el-row>
          <el-row>
              <el-col :span="12">
                  <el-form-item label="住院时间" >
                      <el-input placeholder="请输入住院时间" suffix-icon="el-icon-date" v-model="form.date"></el-input>
                  </el-form-item>
              </el-col>
              <el-col :span="12">
                  <el-form-item label="症状" >
                      <el-input v-model="form.symp"></el-input>
                  </el-form-item>
              </el-col>
          </el-row>  
          <el-form-item label="备注">
              <el-input type="textarea" v-model="form.desc" rows="4"></el-input>
          </el-form-item>
        </el-form>
    </div>
</template>
<script>
import request from '@/utils/request'

  export default {
    data() {
      return {
        form: {
          area: '',
          name: '',
          phone: '',
          idcard: '',
          address: '',
          carNumber: '',
          isHealthy: 1,
          temper:undefined,
          history:'',
          desc: '',
          age:undefined,
          isSevere:0,
          gender:'',
          date:'',
          symp:'',
        },
      }
    },
    created(){
        this.fetchData()
    },
    methods: {
        fetchData(){
            request({
                url:'../patient_info.json',
                method:'get'
            }).then((response) =>{
                this.form =response.data
                console.log(response.data)
            })
        },
        handleEdit(){
            this.$router.push({
                path:'/patient/modify'
            })
        },
    }
  }
</script>
